package com.region.integral.common_user.obtain.dao.delegate;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.region.integral.common_user.obtain.dao.IIntegralAuthentication;
import com.region.integral.common_user.obtain.dao.IIntegralCommentGoods;
import com.region.integral.common_user.obtain.dao.IIntegralCommentWeiBo;
import com.region.integral.common_user.obtain.dao.IIntegralGroupPeopleRise;
import com.region.integral.common_user.obtain.dao.IIntegralInviteFriend;
import com.region.integral.common_user.obtain.dao.IIntegralIssueActivity;
import com.region.integral.common_user.obtain.dao.IIntegralJoinActivity;
import com.region.integral.common_user.obtain.dao.IIntegralJoinGroup;
import com.region.integral.common_user.obtain.dao.IIntegralLogin;
import com.region.integral.common_user.obtain.dao.IIntegralOnline;
import com.region.integral.common_user.obtain.dao.IIntegralRegister;
import com.region.integral.common_user.obtain.dao.IIntegralReplyComment;
import com.region.integral.common_user.obtain.dao.IIntegralSendWeiBo;
import com.region.integral.common_user.obtain.vo.IntegralData;
import com.region.integral.exception.IntegralException;
@Component("obtain_regulationObjectDelegate")
public class RegulationObjectDelegate {
	@Resource(name="iAuthentication")
	private IIntegralAuthentication iAuthentication;
	@Resource(name="iCommentGoods")
	private IIntegralCommentGoods iCommentGoods;
	@Resource(name="iCommentWeiBo")
	private IIntegralCommentWeiBo iCommentWeiBo;
	@Resource(name="iPeopleRise")
	private IIntegralGroupPeopleRise iPeopleRise;
	@Resource(name="inviteFriend")
	private IIntegralInviteFriend inviteFriend;
	@Resource(name="issueActivity")
	private IIntegralIssueActivity issueActivity;
	@Resource(name="iJoinActivity")
	private IIntegralJoinActivity iJoinActivity;
	@Resource(name="iJoinGroup")
	private IIntegralJoinGroup iJoinGroup;
	@Resource(name="iLogin")
	private IIntegralLogin iLogin;
	@Resource(name="iOnline")
	private IIntegralOnline iOnline;
	@Resource(name="iRegister")
	private IIntegralRegister iRegister;
	@Resource(name="iReplyComment")
	private IIntegralReplyComment iReplyComment;
	@Resource(name="iSendWeiBo")
	private IIntegralSendWeiBo iSendWeiBo;
	
	public boolean authenticationDelegate(int userid,String authWay){
		IntegralData integralData = new IntegralData();
		try {
			iAuthentication.authentication(userid, authWay, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}
	public boolean commentGoodsDelegate(int userid){
		IntegralData integralData = new IntegralData();
		try {
			iCommentGoods.commentGoods(userid, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}
	public boolean commentWeiBoDelegate(int userid){
		IntegralData integralData = new IntegralData();
		try {
			iCommentWeiBo.commentWeiBo(userid, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}
	public boolean groupPeopleRiseDelegate(int userid,String obtainWay){
		IntegralData integralData = new IntegralData();
		try {
			iPeopleRise.groupPeopleRise(userid, obtainWay, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}
	public boolean inviteFriendDelegate(int userid,int inviteFriendNum){
		IntegralData integralData = new IntegralData();
		try {
			inviteFriend.inviteFriend(userid, inviteFriendNum, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}
	public boolean issueActivityDelegate(int userid){
		IntegralData integralData = new IntegralData();
		try {
			issueActivity.issueActivity(userid, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}
	public boolean joinActivityDelagate(int userid){
		IntegralData integralData = new IntegralData();
		try {
			iJoinActivity.joinActivity(userid, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}
	public boolean joinGroupDelegate(int userid){
		IntegralData integralData = new IntegralData();
		try {
			iJoinGroup.joinGroup(userid, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}
	public boolean loginDelegate(int userid){
		IntegralData integralData = new IntegralData();
		try {
			iLogin.login(userid, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}
	public boolean onlineDelegate(int userid){
		IntegralData integralData = new IntegralData();
		try {
			iOnline.online(userid, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}
	public boolean registerDelegate(int userid){
		IntegralData integralData = new IntegralData();
		try {
			iRegister.register(userid, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}
	public boolean replyCommentDelegate(int userid){
		IntegralData integralData = new IntegralData();
		try {
			iReplyComment.replyComment(userid, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}
	public boolean sendWeiBoDelegate(int userid,String medal){
		IntegralData integralData = new IntegralData();
		try {
			iSendWeiBo.sendWeiBo(userid, medal, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}
}
